﻿<div style="display:flex;align-items:center;">
    <MIcon IconName="@iconName" ClassName="svg-icon"></MIcon>
    &nbsp;
    <IconSelector @bind-Value="@iconName" OnChanged="Notify"></IconSelector>
</div>

@code {
    [Parameter, NotNull] public ColumnItemContext? Context { get; set; }
    string? iconName;
    protected override void OnInitialized()
    {
        base.OnInitialized();
        iconName = Context.GetValue() as string;
    }

    Task Notify()
    {
        if (iconName != null)
            Context.SetValue(iconName);
        return Task.CompletedTask;
    }
}
